Skip to content

Improve testing of architecture checks#48139

Closed
scottfrederick wants to merge 1 commit into
spring-projects:3.5.xfrom
scottfrederick:gh-47443-archunit-testing
Closed

Improve testing of architecture checks#48139
scottfrederick wants to merge 1 commit into
spring-projects:3.5.xfrom
scottfrederick:gh-47443-archunit-testing

Conversation

@scottfrederick

@scottfrederick scottfrederick commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Fixes #47443

There were a couple of problems in the architecture rules that were uncovered by the tests.

When performing checks that involve getting the set of properties on an annotation, like this:

JavaAnnotation<?> annotation = ((HasAnnotations<?>) item).getAnnotationOfType(annotationClass);
Map<String, Object> properties = annotation.getProperties();

The properties map will contain entries for all properties that exist on the annotation class, not just the properties that are set in the source code that uses the annotation. A few rules that assumed only the properties that were explicitly set in the annotation usage would be present in the properties map needed some modification.

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 14, 2025
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 14, 2025
@philwebb philwebb added this to the 3.4.x milestone Nov 14, 2025
@snicoll snicoll modified the milestones: 3.4.x, 3.5.x Nov 15, 2025
@snicoll snicoll self-assigned this Dec 1, 2025
@snicoll snicoll modified the milestones: 3.5.x, 3.5.9 Dec 1, 2025
snicoll pushed a commit that referenced this pull request Dec 1, 2025
See gh-48139

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
snicoll added a commit that referenced this pull request Dec 1, 2025
@snicoll snicoll closed this in 6bdf47b Dec 1, 2025
@scottfrederick
scottfrederick deleted the gh-47443-archunit-testing branch December 1, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants